<?xml version="1.0" encoding="UTF-8"?>

<!-- Document : listPageByUser.xsl Created on : November 15, 2013, 7:43 AM 
	Author : BAOLA Description: Purpose of transformation follows. -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:a="http://xml.netbeans.org/schema/account" exclude-result-prefixes="a"
	version="1.0">
    <xsl:output method="html" />
    <xsl:param name="username"></xsl:param>
	<!-- TODO customize transformation rules syntax recommendation http://www.w3.org/TR/xslt -->
    <xsl:template match="/">
        <ul class="list clearfix">
            <xsl:for-each select="//a:UserPage[a:username=$username and a:isActive='true']">
                <li class="clearfix">
                    <section class="left">
                        <img src="images/list-default-thumb.png" alt="default thumb"
							class="thumb"/>
                        <h3>
                            <xsl:value-of select="a:pagename"></xsl:value-of>
                        </h3>
                        <span class="meta">Page link:
                            <a target="_blank">
                                <xsl:attribute name="href">https://www.facebook.com/<xsl:value-of select="a:fbPageId"/></xsl:attribute>
                                https://www.facebook.com/<xsl:value-of select="a:fbPageId"/>
                            </a>
                        </span>
                        <p>
                            <xsl:value-of select="a:description"/>
                        </p>
                    </section>
                    <section class="right">
                        <span class="darkview">
                            <a class="btn btn-info">
                                <xsl:attribute name="href">editpage.jsp?pageId=<xsl:value-of select="a:pageId"/></xsl:attribute>
                                Edit Info</a>
                            <a class="btn btn-extend">
                                <xsl:attribute name="href">browse.jsp?pageId=<xsl:value-of select="a:pageId"/>
                                </xsl:attribute>
                                Browse</a>
                            <a class="btn btn-extend">
                                <xsl:attribute name="href">reviewFb.action?pageId=<xsl:value-of select="a:pageId"/>
                                </xsl:attribute>
                                Review</a>
                        </span>
                    </section>
                </li>
            </xsl:for-each>
            <xsl:for-each select="//a:UserPage[a:username=$username and a:isActive='false' and a:role='owner']">
                <li class="clearfix">
                    <section class="left">
                        <img src="images/list-default-thumb.png" alt="default thumb"
							class="thumb"/>
                        <h3>
                            <xsl:value-of select="a:pagename"></xsl:value-of>
                        </h3>
                        <span class="meta">Page link:
                            <a>
                                <xsl:attribute name="href">https://www.facebook.com/<xsl:value-of select="a:fbPageId"/></xsl:attribute>
                                https://www.facebook.com/<xsl:value-of select="a:fbPageId"/>
                            </a>
                        </span>
                        <p>
                            <xsl:value-of select="a:description"/>
                        </p>
                    </section>
                    <section class="right">
                        <span class="darkview">
                            <a class="btn btn-extend">
                                <xsl:attribute name="href">reactivePage.action?pageId=<xsl:value-of select="a:pageId"/>
                                </xsl:attribute>
                                Reactive</a>
                        </span>
                    </section>
                </li>
            </xsl:for-each>
        </ul>
    </xsl:template>
</xsl:stylesheet>
